using System;
using SMS.Entities.BaseClasses;

namespace SMS.Entities
{
    public class SaleHistory : BaseEntity
    {

        private Int32 _Sale_ID;
        public Int32 Sale_ID
        {
            get { return _Sale_ID; }
            set
            {
                _Sale_ID = value;
                OnPropertyChanged("Sale_ID");
            }
        }

        private Customer _Customer;
        public Customer Customer
        {
            get { return _Customer; }
            set
            {
                _Customer = value;
                OnPropertyChanged("Customer");
            }
        }

        private Decimal _TotalSellingPrice;
        public Decimal TotalSellingPrice
        {
            get { return _TotalSellingPrice; }
            set
            {
                _TotalSellingPrice = value;
                OnPropertyChanged("TotalSellingPrice");
            }
        }

        private Decimal _ActualSelliingPrice;
        public Decimal ActualSelliingPrice
        {
            get { return _ActualSelliingPrice; }
            set
            {
                _ActualSelliingPrice = value;
                OnPropertyChanged("ActualSelliingPrice");
            }
        }

        private Decimal _BuyingPrice;
        public Decimal BuyingPrice
        {
            get { return _BuyingPrice; }
            set
            {
                _BuyingPrice = value;
                OnPropertyChanged("BuyingPrice");
            }
        }

        private Decimal _Discount;
        public Decimal Discount
        {
            get { return _Discount; }
            set
            {
                _Discount = value;
                OnPropertyChanged("Discount");
            }
        }

        private decimal _PaidAmount;

        public decimal PaidAmount
        {
            get { return _PaidAmount; }
            set { _PaidAmount = value; OnPropertyChanged("PaidAmount"); }
        }


        private DateTime _Selling_Date;
        public DateTime Selling_Date
        {
            get { return _Selling_Date; }
            set
            {
                _Selling_Date = value;
                OnPropertyChanged("Selling_Date");
            }
        }

        private SalesManDetail _SalesMan;
        public SalesManDetail SalesMan
        {
            get { return _SalesMan; }
            set
            {
                _SalesMan = value;
                OnPropertyChanged("SalesMan");
            }
        }

        private Int32 _Counter_ID;
        public Int32 Counter_ID
        {
            get { return _Counter_ID; }
            set
            {
                _Counter_ID = value;
                OnPropertyChanged("Counter_ID");
            }
        }

        private Boolean _Is_Paid;
        public Boolean Is_Paid
        {
            get { return _Is_Paid; }
            set
            {
                _Is_Paid = value;
                OnPropertyChanged("Is_Paid");
#if SILVERLIGHT
                if (value)
                    PaidAmount = ActualSelliingPrice;
                else
                    PaidAmount = 0;
#endif
            }
        }

        private string _Remarks;

        public string Remarks
        {
            get { return _Remarks; }
            set
            {
                _Remarks = value;
                OnPropertyChanged("Remarks");
            }
        }

        private Decimal _Received;

        public Decimal Received
        {
            get { return _Received; }
            set
            {
                _Received = value;
                OnPropertyChanged("Received");
                Return = value - ActualSelliingPrice;
            }
        }

        private Decimal _Return;

        public Decimal Return
        {
            get { return _Return; }
            set { _Return = value; OnPropertyChanged("Return"); }
        }



        private System.Collections.ObjectModel.ObservableCollection<SaleDetail> _SalesDetailList;

        public System.Collections.ObjectModel.ObservableCollection<SaleDetail> SalesDetailList
        {
            get { return _SalesDetailList; }
            set
            {
                _SalesDetailList = value;
                OnPropertyChanged("SalesDetailList");
            }
        }


    }
}